package wuxianshua.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import wuxianshua.pojo.Advance;
import wuxianshua.pojo.Prototype;
import wuxianshua.pojo.Score;
import wuxianshua.pojo.Series;
import wuxianshua.service.ScoreService;

import javax.websocket.server.PathParam;
import java.util.List;
import java.util.Map;

/**
 * Description:
 * Datetime:    2021/3/23   19:52
 * Author:   jianglei
 */
@RestController
public class ScoreController {
    @Autowired
    private ScoreService scoreService;


    @RequestMapping("/performance")
    public Map getAll() {
        return scoreService.getPerformance();
    }

    @RequestMapping("/getscorebyprototype/{prototype}")
    public Map getScoreByProtoType(@PathVariable("prototype") String prototype) {
        return scoreService.getScoreByProtoType(prototype);
    }


    @RequestMapping("/getscorebyadvance/{advance}")
    public Map getScoreByAdvance(@PathVariable("advance") String advance) {
        return scoreService.getScoreByAdvance(advance);
    }

    @RequestMapping("/getscorebyorign")
    public Map getScoreByOrign() {
        return scoreService.getScoreByOrign();
    }

    @RequestMapping("/getadvance")
    public List<Advance> getAdvance(){
        return scoreService.getAdvance();
    }

    @RequestMapping("/getprototype")
    public List<Prototype> getProtoType(){
        return scoreService.getProtoType();
    }


    @RequestMapping("/getcustom")
    public Map getCustom() {
        return scoreService.getScoreByCustom();
    }

}
